package com.mutual.help.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.mutual.help.dao.QuestionMapper;
import com.mutual.help.dao.TypeMapper;
import com.mutual.help.entity.Question;
import com.mutual.help.entity.Type;
import com.mutual.help.service.QuestionService;
import com.mutual.help.service.TypeService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> implements QuestionService {

    @Override
    public List<Question> getAllQuestion(Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Question> questions = baseMapper.getAllQuestion();
        return questions;
    }

    @Override
    public Integer countData() {
        List<Question> questions = baseMapper.selectList(null);
        return questions.size();
    }
}
